<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript">
	$(function() {
		window.setTimeout(function() {
			parent.$.messager.progress('close');
		}, 1);

		$('#form').form({
			url : '${pageContext.request.contextPath}/business/accounting/kMSZJBSJ/edit.shtml',
			onSubmit : function() {
				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				console.info(isValid);
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				parent.$.messager.progress('close');
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				} else {
					parent.$.messager.alert('错误', result.msg, 'error');
				}
			}
		});
	});
	 function loadValidate() {  
         //科目编号  
         $("#kmbh").validatebox({  
             required: true,  
             missingMessage:"必填项！"  
         });  
         //科目名称 
         $("#kmmc").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
  
         });  
         //输入年初余额,本年累计借方,本年累计贷方,余额
         $("#ncye").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         });
         $("#bnljjf").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         }); 
         $("#bnljdf").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         });
         $("#kjkmlb").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         }); 
         $("#fzhslx").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         }); 
         $("#ye").validatebox({  
             required: true,  
             missingMessage: "必填项！",  
         }); 
     } 
	 //验证是否为两位小数
	 $.extend($.fn.validatebox.defaults.rules, {
		 intOrFloat: {// 验证整数或小数
			 validator: function (value) {
			 return  /^\d+(\.\d{1,2})?$/.test(value);
			 },
			 message: '格式错误,小数点后保留两位'
			 }
		});
</script>
<div class="div_center">
	<div class="easyui-layout" data-options="fit:true,border:false">
		<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
			<form id="form" method="post" enctype="multipart/form-data" >
				<table class="form_view_border" border="1px" cellpadding="0" cellspacing="0" align="center"  id="table_id">
				<tr>
					<th class="panel-header" >账套名称</th>
					<td> 
					  <select  class="easyui-combobox" name="ZTDM" style="width:200px; height: 27px;" disabled="disabled">
	                        <option>请选择</option>
	                         <c:forEach var="zt"   items="${ztlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.ZTDM== zt.ZTDM}"> 
								<option value="${zt.ZTDM}" selected="selected" >${zt.ZTMC}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.ZTDM!=zt.ZTDM}"> 
								<option value="${zt.ZTDM}"  >${zt.ZTMC}</option>
							 </c:if>
	                		 </c:forEach>
                       </select> 
                         <th class="panel-header" >会计年度</th>
					<td>
					    <select  class="easyui-combobox" name="KJND" style="width:200px; height: 27px;" disabled="disabled">
                        <option value=''>请选择</option>
                         <c:forEach var="kj"   items="${kjndlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.KJND== kj.code}"> 
								<option value="${kj.code}" selected="selected" >${kj.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.KJND!=kj.code}"> 
								<option value="${kj.code}">${kj.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>    
                    </td>
				</tr>
				<tr>
					<th class="panel-header" >科目编号 </th>
					<td>
					  <input name="PKMBH" type="text" class="span2" style="width:80px; height: 27px; background-color:#EBEBE5;" value="${pkm.KMBH}" class="form_view_input combo easyui-validatebox"  readonly="true">
					   &nbsp;&nbsp;&nbsp;&nbsp;
					      <c:choose>
						   <c:when test="${ptemp==1}">  
					      <input name="KMBH" type="text" class="span2" style="width:80px; height: 27px; background-color:#EBEBE5;" value="${KMSZXGLSSJ.KMBH}" class="form_view_input combo easyui-validatebox" readonly="true">
					       </c:when>
					       <c:otherwise> 
						   <input name="KMBH" type="text" class="span2" style="width:80px; height: 27px;" value="${KMSZXGLSSJ.KMBH}" class="form_view_input combo easyui-validatebox" >
						   </c:otherwise>
                        </c:choose>
					</td>
					<th class="panel-header" >科目名称</th>
					<td>
					  <input name="kMSZJBSJ" type="text" class="span2" style="width:80px; height: 27px;background-color:#EBEBE5;" value="${pkm.KMMC}" class="form_view_input combo easyui-validatebox" readonly="true" >
					  &nbsp;&nbsp;&nbsp;&nbsp;
						  <input name="KMMC" type="text" class="span2" style="width:80px; height: 27px;" value="${KMSZXGLSSJ.KMMC}" class="form_view_input combo easyui-validatebox" >
				   </td>
				</tr>
				<tr>
					<th class="panel-header" >科目级别 </th>
					<td><input name="KMJB" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.KMJB}" class="form_view_input combo easyui-validatebox" readonly="true" ></td>
					<th class="panel-header" >核算单位 </th>
					<td><input name="HSDW" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="上海公积金" class="form_view_input combo easyui-validatebox" readonly="true" ></td>
				</tr>
				<tr>
				  <th class="panel-header" >科目属性</th>
					<td>
					    <select  class="easyui-combobox" name="KMSX" style="width:200px; height: 27px;" disabled="disabled" >
                        <option value=''>请选择</option>
                         <c:forEach var="km"   items="${kmsxlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.KMSX== km.code}"> 
								<option value="${km.code}" selected="selected" >${km.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.KMSX!=km.code}"> 
								<option value="${km.code}">${km.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>          
                   </td>
					<th class="panel-header">余额方向</th>
					<td>
					    <select id="yefx" class="easyui-combobox" name="KMYEFX" style="width:200px; height: 27px;" >
                        <option>请选择</option>
                        <c:forEach var="ye"   items="${yefxlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.KMYEFX== ye.code}"> 
								<option value="${ye.code}" selected="selected" >${ye.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.KMYEFX!=ye.code}"> 
								<option value="${ye.code}">${ye.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>         
                    </td>
				</tr>
				<tr>
				   <th class="panel-header" >末级标记 </th>
					<td>  
					    <select   class="easyui-combobox" name="SFMJKM" style="width:200px; height: 27px;"disabled="disabled">
                        <option>请选择</option>
                         <c:forEach var="mj"   items="${mjbjlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.SFMJKM== mj.code}"> 
								<option value="${mj.code}" selected="selected" >${mj.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.SFMJKM!=mj.code}"> 
								<option value="${mj.code}">${mj.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>     
                    </td>
				    <th class="panel-header">台账标记</th>
					<td>
					    <select id="tzbj" class="easyui-combobox" name="TZBJ" style="width:200px; height: 27px;">
                        <option>请选择</option>
                         <c:forEach var="tz"   items="${tzbjlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.TZBJ== tz.code}"> 
								<option value="${tz.code}" selected="selected" >${tz.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.TZBJ!=tz.code}"> 
								<option value="${tz.code}">${tz.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>     
					</td>
				</tr>
				<tr>
				    <th class="panel-header">日记账类型</th>
					 <td> 
					    <select id="rjzlx" class="easyui-combobox" name="RJZLX" style="width:200px; height: 27px;" >
                        <option>请选择</option>
                         <c:forEach var="rjz"   items="${rjzlxlist}" >
							 <c:if test="${KMSZXGLSSJ!=null && KMSZXGLSSJ.RJZLX== rjz.code}"> 
								<option value="${rjz.code}" selected="selected" >${rjz.name}</option>
							 </c:if>	
							 <c:if test="${KMSZXGLSSJ==null || KMSZXGLSSJ.RJZLX!=rjz.code}"> 
								<option value="${rjz.code}">${rjz.name}</option>
							 </c:if>
                		 </c:forEach>
                        </select>  
                    </td>
					<th class="panel-header">年初余额</th>
					<td><input name="NCYE" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.NCYE}" class="form_view_input combo easyui-validatebox" readonly="true" ></td>
				</tr>
				<tr>
				    <th class="panel-header" >余额 </th>
					<td><input name="YE" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.YE}" class="form_view_input combo easyui-validatebox" readonly="true" ></td>
					<th class="panel-header">本年累计借方</th>
					<td><input name="BNLJJF" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.NCYE}" class="form_view_input combo easyui-validatebox"  readonly="true"></td>
				</tr>
				<tr>
				    <th class="panel-header" >会计科目类别</th>
					<td><input id="kjkmlb" name="KJKMLB" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.KJKMLB}" class="form_view_input combo easyui-validatebox"  readonly="true"></td>
					<th class="panel-header">辅助核算类型</th>
					<td><input id="fzhslx" name="FZHSLX" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.FZHSLX}" class="form_view_input combo easyui-validatebox" readonly="true" ></td>
				</tr>
				 <tr>
					<th class="panel-header" >本年累计贷方 </th>
					<td><input name="BNLJDF" type="text" class="span2" style="width:200px; height: 27px;background-color:#EBEBE5;" value="${KMSZXGLSSJ.BNLJDF}" class="form_view_input combo easyui-validatebox" ></td>
					<th class="panel-header">辅助核算</th>
					<td style="display:none;">
					</td>
				 </tr>
				 <td style="display:none;">
					<input type="text" name="KMSZID" value="${KMSZXGLSSJ.KMSZID}">
					</td>
				 
				  <tr  style="display:none;">
					<th class="panel-header"  >ID </th>
					<td>
					<input type="text" name="ID" value="${KMSZXGLSSJ.ID}">
					</td>
					
					<th class="panel-header"  >ZT </th>
					<td>
					<input type="text" name="ZT" value="${KMSZXGLSSJ.ZT}">
					</td>
					
					<th class="panel-header"  >SPZT </th>
					<td>
					<input type="text" name="SPZT" value="${KMSZXGLSSJ.SPZT}">
					</td>
					
				 </tr>
				</table>
			</form>
		</div>
	</div>
</div>
 